/**
 * @file task_led.h
 * @brief 
 * @author Tome (baojian.liu-a1105@aqara.com)
 * @date 2021-03-23
 */
 
// include 
#include "hal_types.h"
#include "osal_log.h"

 

#ifndef TASK_LED_h
#define TASK_LED_h
 
 
 
/****************************************************************************************************************************** 
                                                            const
*******************************************************************************************************************************/



#define TASK_LED_EVT_BRUSH_LAYER          0x0001      //
#define TASK_LED_EVT_NEXT_LAYER          0x0002



#define LED_LAYER_NORMAL        0
#define LED_LAYER_ONCE          1
#define LED_LAYER_WARN          2


/****************************************************************************************************************************** 
                                                            typedef
*******************************************************************************************************************************/










/****************************************************************************************************************************** 
                                                            MICRO
*******************************************************************************************************************************/

#if LOG_CODE(LED)
#define LEDLOG(__FMT__ , ...)   LOG("[ALED]{}:"__FMT__,##__VA_ARGS__)
#define LEDDUMP(a,b)            LOG_DUMP_HEX(a,b)
#else
#define LEDLOG(...)
#define LEDDUMP(...)
#endif






/****************************************************************************************************************************** 
                                                            declearation
*******************************************************************************************************************************/

extern uint8 Led_TaskID;;


extern void Led_Init( uint8 task_id );
extern uint16 Led_ProcessEvent( uint8 task_id, uint16 events );

extern void task_led_set_lower(uint8 layer, uint8 leds, uint8 mode, uint8 duty, uint16 period, uint8 cycle, uint8 reset);
extern void task_led_set(uint8 layer, uint8 leds, uint8 mode, uint8 duty, uint16 period, uint8 cycle);
extern void task_led_set_cover(uint8 layer, uint8 leds, uint8 mode, uint8 duty, uint16 period, uint8 cycle);

extern void task_led_err_code(uint8 code);

#endif //TASK_LED_h
